{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd \n",
    "import cnmaps\n",
    "import numpy as np\n",
    "from shapely.geometry import Point\n",
    "import glob\n",
    "import polars"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "provincelist=['广西壮族自治区','广东省','海南省','福建省','台湾省','浙江省','江苏省','上海市','山东省','辽宁省']\n",
    "filepath=glob.glob(r'D:\\WORKcode\\pythoncode\\ncdata\\typath\\CMA_csv\\*')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2003\n"
     ]
    },
    {
     "ename": "InvalidXlsxFileException",
     "evalue": "Invalid xlsx file: D:\\WORKcode\\pythoncode\\ncdata\\typath\\CMA_csv\\2003.xls",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mBadZipFile\u001b[0m                                Traceback (most recent call last)",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\site-packages\\xlsx2csv.py:201\u001b[0m, in \u001b[0;36mXlsx2csv.__init__\u001b[1;34m(self, xlsxfile, **options)\u001b[0m\n\u001b[0;32m    200\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m--> 201\u001b[0m     \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mziphandle \u001b[39m=\u001b[39m zipfile\u001b[39m.\u001b[39;49mZipFile(xlsxfile)\n\u001b[0;32m    202\u001b[0m \u001b[39mexcept\u001b[39;00m (zipfile\u001b[39m.\u001b[39mBadZipfile, \u001b[39mIOError\u001b[39;00m):\n",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\zipfile.py:1267\u001b[0m, in \u001b[0;36mZipFile.__init__\u001b[1;34m(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)\u001b[0m\n\u001b[0;32m   1266\u001b[0m \u001b[39mif\u001b[39;00m mode \u001b[39m==\u001b[39m \u001b[39m'\u001b[39m\u001b[39mr\u001b[39m\u001b[39m'\u001b[39m:\n\u001b[1;32m-> 1267\u001b[0m     \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_RealGetContents()\n\u001b[0;32m   1268\u001b[0m \u001b[39melif\u001b[39;00m mode \u001b[39min\u001b[39;00m (\u001b[39m'\u001b[39m\u001b[39mw\u001b[39m\u001b[39m'\u001b[39m, \u001b[39m'\u001b[39m\u001b[39mx\u001b[39m\u001b[39m'\u001b[39m):\n\u001b[0;32m   1269\u001b[0m     \u001b[39m# set the modified flag so central directory gets written\u001b[39;00m\n\u001b[0;32m   1270\u001b[0m     \u001b[39m# even if no files are added to the archive\u001b[39;00m\n",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\zipfile.py:1334\u001b[0m, in \u001b[0;36mZipFile._RealGetContents\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m   1333\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m endrec:\n\u001b[1;32m-> 1334\u001b[0m     \u001b[39mraise\u001b[39;00m BadZipFile(\u001b[39m\"\u001b[39m\u001b[39mFile is not a zip file\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[0;32m   1335\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mdebug \u001b[39m>\u001b[39m \u001b[39m1\u001b[39m:\n",
      "\u001b[1;31mBadZipFile\u001b[0m: File is not a zip file",
      "\nDuring handling of the above exception, another exception occurred:\n",
      "\u001b[1;31mInvalidXlsxFileException\u001b[0m                  Traceback (most recent call last)",
      "\u001b[1;32md:\\WORKcode\\pythoncode\\ncdata\\typath\\tyDenglu_count_speed.ipynb Cell 3\u001b[0m in \u001b[0;36m<cell line: 3>\u001b[1;34m()\u001b[0m\n\u001b[0;32m     <a href='vscode-notebook-cell:/d%3A/WORKcode/pythoncode/ncdata/typath/tyDenglu_count_speed.ipynb#W2sZmlsZQ%3D%3D?line=9'>10</a>\u001b[0m \u001b[39mfor\u001b[39;00m province_i \u001b[39min\u001b[39;00m provincelist:\n\u001b[0;32m     <a href='vscode-notebook-cell:/d%3A/WORKcode/pythoncode/ncdata/typath/tyDenglu_count_speed.ipynb#W2sZmlsZQ%3D%3D?line=10'>11</a>\u001b[0m     countdict[\u001b[39mstr\u001b[39m(i[\u001b[39m-\u001b[39m\u001b[39m8\u001b[39m:\u001b[39m-\u001b[39m\u001b[39m4\u001b[39m])][province_i]\u001b[39m=\u001b[39m\u001b[39m0\u001b[39m\n\u001b[1;32m---> <a href='vscode-notebook-cell:/d%3A/WORKcode/pythoncode/ncdata/typath/tyDenglu_count_speed.ipynb#W2sZmlsZQ%3D%3D?line=11'>12</a>\u001b[0m df\u001b[39m=\u001b[39mpolars\u001b[39m.\u001b[39;49mread_excel(i)\n\u001b[0;32m     <a href='vscode-notebook-cell:/d%3A/WORKcode/pythoncode/ncdata/typath/tyDenglu_count_speed.ipynb#W2sZmlsZQ%3D%3D?line=12'>13</a>\u001b[0m \u001b[39m# 去除重复的名字\u001b[39;00m\n\u001b[0;32m     <a href='vscode-notebook-cell:/d%3A/WORKcode/pythoncode/ncdata/typath/tyDenglu_count_speed.ipynb#W2sZmlsZQ%3D%3D?line=13'>14</a>\u001b[0m namelist\u001b[39m=\u001b[39mdf[\u001b[39m'\u001b[39m\u001b[39mname_en\u001b[39m\u001b[39m'\u001b[39m]\u001b[39m.\u001b[39mdrop_duplicates()\u001b[39m.\u001b[39mreset_index()[\u001b[39m'\u001b[39m\u001b[39mname_en\u001b[39m\u001b[39m'\u001b[39m]\n",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\site-packages\\polars\\io.py:1241\u001b[0m, in \u001b[0;36mread_excel\u001b[1;34m(file, sheet_id, sheet_name, xlsx2csv_options, read_csv_options)\u001b[0m\n\u001b[0;32m   1238\u001b[0m     read_csv_options \u001b[39m=\u001b[39m {}\n\u001b[0;32m   1240\u001b[0m \u001b[39m# Convert sheets from XSLX document to CSV.\u001b[39;00m\n\u001b[1;32m-> 1241\u001b[0m parser \u001b[39m=\u001b[39m xlsx2csv\u001b[39m.\u001b[39mXlsx2csv(file, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mxlsx2csv_options)\n\u001b[0;32m   1243\u001b[0m \u001b[39mif\u001b[39;00m (sheet_name \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m) \u001b[39mor\u001b[39;00m ((sheet_id \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m) \u001b[39mand\u001b[39;00m (sheet_id \u001b[39m>\u001b[39m \u001b[39m0\u001b[39m)):\n\u001b[0;32m   1244\u001b[0m     \u001b[39mreturn\u001b[39;00m _read_excel_sheet(parser, sheet_id, sheet_name, read_csv_options)\n",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\site-packages\\xlsx2csv.py:203\u001b[0m, in \u001b[0;36mXlsx2csv.__init__\u001b[1;34m(self, xlsxfile, **options)\u001b[0m\n\u001b[0;32m    201\u001b[0m     \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mziphandle \u001b[39m=\u001b[39m zipfile\u001b[39m.\u001b[39mZipFile(xlsxfile)\n\u001b[0;32m    202\u001b[0m \u001b[39mexcept\u001b[39;00m (zipfile\u001b[39m.\u001b[39mBadZipfile, \u001b[39mIOError\u001b[39;00m):\n\u001b[1;32m--> 203\u001b[0m     \u001b[39mraise\u001b[39;00m InvalidXlsxFileException(\u001b[39m\"\u001b[39m\u001b[39mInvalid xlsx file: \u001b[39m\u001b[39m\"\u001b[39m \u001b[39m+\u001b[39m \u001b[39mstr\u001b[39m(xlsxfile))\n\u001b[0;32m    205\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mpy3 \u001b[39m=\u001b[39m sys\u001b[39m.\u001b[39mversion_info[\u001b[39m0\u001b[39m] \u001b[39m==\u001b[39m \u001b[39m3\u001b[39m\n\u001b[0;32m    207\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcontent_types \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_parse(ContentTypes, \u001b[39m\"\u001b[39m\u001b[39m/[Content_Types].xml\u001b[39m\u001b[39m\"\u001b[39m)\n",
      "\u001b[1;31mInvalidXlsxFileException\u001b[0m: Invalid xlsx file: D:\\WORKcode\\pythoncode\\ncdata\\typath\\CMA_csv\\2003.xls"
     ]
    }
   ],
   "source": [
    "# 字典计数器 记录各省台风的登陆个数\n",
    "countdict={}\n",
    "for i in filepath:\n",
    "    # print(i[-8:-4])\n",
    "    if int(i[-8:-4]) not in np.arange(2003,2020,1):\n",
    "        continue\n",
    "    print(i[-8:-4])\n",
    "    countdict[str(i[-8:-4])]={}\n",
    "    # 计数器初始化\n",
    "    for province_i in provincelist:\n",
    "        countdict[str(i[-8:-4])][province_i]=0\n",
    "    df=polars.read_excel(i)\n",
    "    # 去除重复的名字\n",
    "    namelist=df['name_en'].drop_duplicates().reset_index()['name_en']\n",
    "    for name_i in namelist:\n",
    "        temp=df[df['name_en']==name_i]\n",
    "        out_proviceloop=False\n",
    "        '''判断这个台风在那个省份登陆，循环判断'''\n",
    "        for province_i in provincelist:\n",
    "            # 把这个省份(区)的区域调出来\n",
    "            Pmap=cnmaps.get_adm_maps(province=province_i,engine='geopandas',only_polygon=False)['geometry'][0]\n",
    "            for lat_i,lon_i in zip(temp['lat'],temp['lon']):\n",
    "                '''判断这个台风的这个点是否在省(区)的区域内,如果是计数器加一,继续下一循环,以此类推,直到所有'''\n",
    "                if Pmap.contains(Point(lon_i,lat_i)):\n",
    "                    countdict[str(i[-8:-4])][province_i]+=1\n",
    "                    # out_proviceloop=True\n",
    "                    break\n",
    "            # if out_proviceloop:\n",
    "            #     '''如果台风已经判断在哪里登陆了，直接跳出两层循环，开始下一个'''\n",
    "            #     break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'2003': {'广西壮族自治区': 3,\n",
       "  '广东省': 2,\n",
       "  '海南省': 2,\n",
       "  '福建省': 1,\n",
       "  '台湾省': 1,\n",
       "  '浙江省': 1,\n",
       "  '江苏省': 0,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2004': {'广西壮族自治区': 0,\n",
       "  '广东省': 2,\n",
       "  '海南省': 0,\n",
       "  '福建省': 1,\n",
       "  '台湾省': 3,\n",
       "  '浙江省': 3,\n",
       "  '江苏省': 1,\n",
       "  '上海市': 0,\n",
       "  '山东省': 1,\n",
       "  '辽宁省': 0},\n",
       " '2005': {'广西壮族自治区': 0,\n",
       "  '广东省': 1,\n",
       "  '海南省': 2,\n",
       "  '福建省': 3,\n",
       "  '台湾省': 2,\n",
       "  '浙江省': 2,\n",
       "  '江苏省': 2,\n",
       "  '上海市': 0,\n",
       "  '山东省': 1,\n",
       "  '辽宁省': 1},\n",
       " '2006': {'广西壮族自治区': 3,\n",
       "  '广东省': 2,\n",
       "  '海南省': 0,\n",
       "  '福建省': 4,\n",
       "  '台湾省': 2,\n",
       "  '浙江省': 0,\n",
       "  '江苏省': 0,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2007': {'广西壮族自治区': 0,\n",
       "  '广东省': 1,\n",
       "  '海南省': 2,\n",
       "  '福建省': 2,\n",
       "  '台湾省': 1,\n",
       "  '浙江省': 2,\n",
       "  '江苏省': 0,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2008': {'广西壮族自治区': 1,\n",
       "  '广东省': 6,\n",
       "  '海南省': 1,\n",
       "  '福建省': 2,\n",
       "  '台湾省': 4,\n",
       "  '浙江省': 1,\n",
       "  '江苏省': 1,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2009': {'广西壮族自治区': 2,\n",
       "  '广东省': 5,\n",
       "  '海南省': 2,\n",
       "  '福建省': 2,\n",
       "  '台湾省': 1,\n",
       "  '浙江省': 2,\n",
       "  '江苏省': 1,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2010': {'广西壮族自治区': 2,\n",
       "  '广东省': 3,\n",
       "  '海南省': 1,\n",
       "  '福建省': 3,\n",
       "  '台湾省': 1,\n",
       "  '浙江省': 1,\n",
       "  '江苏省': 0,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2011': {'广西壮族自治区': 0,\n",
       "  '广东省': 2,\n",
       "  '海南省': 3,\n",
       "  '福建省': 1,\n",
       "  '台湾省': 1,\n",
       "  '浙江省': 0,\n",
       "  '江苏省': 0,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2012': {'广西壮族自治区': 2,\n",
       "  '广东省': 3,\n",
       "  '海南省': 1,\n",
       "  '福建省': 1,\n",
       "  '台湾省': 0,\n",
       "  '浙江省': 1,\n",
       "  '江苏省': 1,\n",
       "  '上海市': 0,\n",
       "  '山东省': 1,\n",
       "  '辽宁省': 0},\n",
       " '2013': {'广西壮族自治区': 4,\n",
       "  '广东省': 3,\n",
       "  '海南省': 3,\n",
       "  '福建省': 4,\n",
       "  '台湾省': 0,\n",
       "  '浙江省': 0,\n",
       "  '江苏省': 0,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2014': {'广西壮族自治区': 1,\n",
       "  '广东省': 2,\n",
       "  '海南省': 0,\n",
       "  '福建省': 2,\n",
       "  '台湾省': 1,\n",
       "  '浙江省': 1,\n",
       "  '江苏省': 1,\n",
       "  '上海市': 1,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2015': {'广西壮族自治区': 1,\n",
       "  '广东省': 1,\n",
       "  '海南省': 1,\n",
       "  '福建省': 2,\n",
       "  '台湾省': 2,\n",
       "  '浙江省': 0,\n",
       "  '江苏省': 1,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2016': {'广西壮族自治区': 2,\n",
       "  '广东省': 2,\n",
       "  '海南省': 2,\n",
       "  '福建省': 3,\n",
       "  '台湾省': 2,\n",
       "  '浙江省': 1,\n",
       "  '江苏省': 1,\n",
       "  '上海市': 0,\n",
       "  '山东省': 0,\n",
       "  '辽宁省': 0},\n",
       " '2017': {'广西壮族自治区': 2,\n",
       "  '广东省': 5,\n",
       "  '海南省': 1,\n",
       "  '福建省': 3,\n",
       "  '台湾省': 2,\n",
       "  '浙江省': 0,\n",
       "  '江苏省': 0,\n",
       "  '上海市': 0,\n",
       "  '山东省': 1,\n",
       "  '辽宁省': 0},\n",
       " '2018': {'广西壮族自治区': 3,\n",
       "  '广东省': 5,\n",
       "  '海南省': 4,\n",
       "  '福建省': 1,\n",
       "  '台湾省': 1,\n",
       "  '浙江省': 1,\n",
       "  '江苏省': 3,\n",
       "  '上海市': 2,\n",
       "  '山东省': 3,\n",
       "  '辽宁省': 1},\n",
       " '2019': {'广西壮族自治区': 2,\n",
       "  '广东省': 2,\n",
       "  '海南省': 3,\n",
       "  '福建省': 1,\n",
       "  '台湾省': 0,\n",
       "  '浙江省': 1,\n",
       "  '江苏省': 1,\n",
       "  '上海市': 0,\n",
       "  '山东省': 1,\n",
       "  '辽宁省': 0}}"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "countdict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2003</th>\n",
       "      <th>2004</th>\n",
       "      <th>2005</th>\n",
       "      <th>2006</th>\n",
       "      <th>2007</th>\n",
       "      <th>2008</th>\n",
       "      <th>2009</th>\n",
       "      <th>2010</th>\n",
       "      <th>2011</th>\n",
       "      <th>2012</th>\n",
       "      <th>2013</th>\n",
       "      <th>2014</th>\n",
       "      <th>2015</th>\n",
       "      <th>2016</th>\n",
       "      <th>2017</th>\n",
       "      <th>2018</th>\n",
       "      <th>2019</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>广西壮族自治区</th>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>广东省</th>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>海南省</th>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>福建省</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>台湾省</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>浙江省</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>江苏省</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>上海市</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>山东省</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>辽宁省</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  \\\n",
       "广西壮族自治区     3     0     0     3     0     1     2     2     0     2     4   \n",
       "广东省         2     2     1     2     1     6     5     3     2     3     3   \n",
       "海南省         2     0     2     0     2     1     2     1     3     1     3   \n",
       "福建省         1     1     3     4     2     2     2     3     1     1     4   \n",
       "台湾省         1     3     2     2     1     4     1     1     1     0     0   \n",
       "浙江省         1     3     2     0     2     1     2     1     0     1     0   \n",
       "江苏省         0     1     2     0     0     1     1     0     0     1     0   \n",
       "上海市         0     0     0     0     0     0     0     0     0     0     0   \n",
       "山东省         0     1     1     0     0     0     0     0     0     1     0   \n",
       "辽宁省         0     0     1     0     0     0     0     0     0     0     0   \n",
       "\n",
       "         2014  2015  2016  2017  2018  2019  \n",
       "广西壮族自治区     1     1     2     2     3     2  \n",
       "广东省         2     1     2     5     5     2  \n",
       "海南省         0     1     2     1     4     3  \n",
       "福建省         2     2     3     3     1     1  \n",
       "台湾省         1     2     2     2     1     0  \n",
       "浙江省         1     0     1     0     1     1  \n",
       "江苏省         1     1     1     0     3     1  \n",
       "上海市         1     0     0     0     2     0  \n",
       "山东省         0     0     0     1     3     1  \n",
       "辽宁省         0     0     0     0     1     0  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 存储为csv\n",
    "df1=pd.DataFrame.from_dict(countdict)\n",
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "ename": "InvalidXlsxFileException",
     "evalue": "Invalid xlsx file: D:/WORKcode/pythoncode/ncdata/typath/CMA_csv/1949.xls",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mBadZipFile\u001b[0m                                Traceback (most recent call last)",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\site-packages\\xlsx2csv.py:201\u001b[0m, in \u001b[0;36mXlsx2csv.__init__\u001b[1;34m(self, xlsxfile, **options)\u001b[0m\n\u001b[0;32m    200\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m--> 201\u001b[0m     \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mziphandle \u001b[39m=\u001b[39m zipfile\u001b[39m.\u001b[39;49mZipFile(xlsxfile)\n\u001b[0;32m    202\u001b[0m \u001b[39mexcept\u001b[39;00m (zipfile\u001b[39m.\u001b[39mBadZipfile, \u001b[39mIOError\u001b[39;00m):\n",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\zipfile.py:1267\u001b[0m, in \u001b[0;36mZipFile.__init__\u001b[1;34m(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)\u001b[0m\n\u001b[0;32m   1266\u001b[0m \u001b[39mif\u001b[39;00m mode \u001b[39m==\u001b[39m \u001b[39m'\u001b[39m\u001b[39mr\u001b[39m\u001b[39m'\u001b[39m:\n\u001b[1;32m-> 1267\u001b[0m     \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_RealGetContents()\n\u001b[0;32m   1268\u001b[0m \u001b[39melif\u001b[39;00m mode \u001b[39min\u001b[39;00m (\u001b[39m'\u001b[39m\u001b[39mw\u001b[39m\u001b[39m'\u001b[39m, \u001b[39m'\u001b[39m\u001b[39mx\u001b[39m\u001b[39m'\u001b[39m):\n\u001b[0;32m   1269\u001b[0m     \u001b[39m# set the modified flag so central directory gets written\u001b[39;00m\n\u001b[0;32m   1270\u001b[0m     \u001b[39m# even if no files are added to the archive\u001b[39;00m\n",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\zipfile.py:1334\u001b[0m, in \u001b[0;36mZipFile._RealGetContents\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m   1333\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m endrec:\n\u001b[1;32m-> 1334\u001b[0m     \u001b[39mraise\u001b[39;00m BadZipFile(\u001b[39m\"\u001b[39m\u001b[39mFile is not a zip file\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[0;32m   1335\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mdebug \u001b[39m>\u001b[39m \u001b[39m1\u001b[39m:\n",
      "\u001b[1;31mBadZipFile\u001b[0m: File is not a zip file",
      "\nDuring handling of the above exception, another exception occurred:\n",
      "\u001b[1;31mInvalidXlsxFileException\u001b[0m                  Traceback (most recent call last)",
      "\u001b[1;32md:\\WORKcode\\pythoncode\\ncdata\\typath\\tyDenglu_count_speed.ipynb Cell 6\u001b[0m in \u001b[0;36m<cell line: 3>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      <a href='vscode-notebook-cell:/d%3A/WORKcode/pythoncode/ncdata/typath/tyDenglu_count_speed.ipynb#W5sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mpolars\u001b[39;00m\n\u001b[0;32m      <a href='vscode-notebook-cell:/d%3A/WORKcode/pythoncode/ncdata/typath/tyDenglu_count_speed.ipynb#W5sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m polars\u001b[39m.\u001b[39mread_excel(\u001b[39m\"\u001b[39m\u001b[39mD:\u001b[39m\u001b[39m\\\u001b[39m\u001b[39mWORKcode\u001b[39m\u001b[39m\\\u001b[39m\u001b[39mpythoncode\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39mncdata\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39ma.xlsx\u001b[39m\u001b[39m\"\u001b[39m,read_csv_options\u001b[39m=\u001b[39m{\u001b[39m'\u001b[39m\u001b[39mhas_header\u001b[39m\u001b[39m'\u001b[39m:\u001b[39mFalse\u001b[39;00m})\n\u001b[1;32m----> <a href='vscode-notebook-cell:/d%3A/WORKcode/pythoncode/ncdata/typath/tyDenglu_count_speed.ipynb#W5sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m polars\u001b[39m.\u001b[39;49mread_excel(\u001b[39m\"\u001b[39;49m\u001b[39mD:/WORKcode/pythoncode/ncdata/typath/CMA_csv/1949.xls\u001b[39;49m\u001b[39m\"\u001b[39;49m)\n",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\site-packages\\polars\\io.py:1241\u001b[0m, in \u001b[0;36mread_excel\u001b[1;34m(file, sheet_id, sheet_name, xlsx2csv_options, read_csv_options)\u001b[0m\n\u001b[0;32m   1238\u001b[0m     read_csv_options \u001b[39m=\u001b[39m {}\n\u001b[0;32m   1240\u001b[0m \u001b[39m# Convert sheets from XSLX document to CSV.\u001b[39;00m\n\u001b[1;32m-> 1241\u001b[0m parser \u001b[39m=\u001b[39m xlsx2csv\u001b[39m.\u001b[39mXlsx2csv(file, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mxlsx2csv_options)\n\u001b[0;32m   1243\u001b[0m \u001b[39mif\u001b[39;00m (sheet_name \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m) \u001b[39mor\u001b[39;00m ((sheet_id \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m) \u001b[39mand\u001b[39;00m (sheet_id \u001b[39m>\u001b[39m \u001b[39m0\u001b[39m)):\n\u001b[0;32m   1244\u001b[0m     \u001b[39mreturn\u001b[39;00m _read_excel_sheet(parser, sheet_id, sheet_name, read_csv_options)\n",
      "File \u001b[1;32md:\\anaconda\\envs\\py310\\lib\\site-packages\\xlsx2csv.py:203\u001b[0m, in \u001b[0;36mXlsx2csv.__init__\u001b[1;34m(self, xlsxfile, **options)\u001b[0m\n\u001b[0;32m    201\u001b[0m     \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mziphandle \u001b[39m=\u001b[39m zipfile\u001b[39m.\u001b[39mZipFile(xlsxfile)\n\u001b[0;32m    202\u001b[0m \u001b[39mexcept\u001b[39;00m (zipfile\u001b[39m.\u001b[39mBadZipfile, \u001b[39mIOError\u001b[39;00m):\n\u001b[1;32m--> 203\u001b[0m     \u001b[39mraise\u001b[39;00m InvalidXlsxFileException(\u001b[39m\"\u001b[39m\u001b[39mInvalid xlsx file: \u001b[39m\u001b[39m\"\u001b[39m \u001b[39m+\u001b[39m \u001b[39mstr\u001b[39m(xlsxfile))\n\u001b[0;32m    205\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mpy3 \u001b[39m=\u001b[39m sys\u001b[39m.\u001b[39mversion_info[\u001b[39m0\u001b[39m] \u001b[39m==\u001b[39m \u001b[39m3\u001b[39m\n\u001b[0;32m    207\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcontent_types \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_parse(ContentTypes, \u001b[39m\"\u001b[39m\u001b[39m/[Content_Types].xml\u001b[39m\u001b[39m\"\u001b[39m)\n",
      "\u001b[1;31mInvalidXlsxFileException\u001b[0m: Invalid xlsx file: D:/WORKcode/pythoncode/ncdata/typath/CMA_csv/1949.xls"
     ]
    }
   ],
   "source": [
    "import polars\n",
    "polars.read_excel(\"D:\\WORKcode\\pythoncode\\\\ncdata\\\\a.xlsx\",read_csv_options={'has_header':False})\n",
    "polars.read_excel(\"D:/WORKcode/pythoncode/ncdata/typath/CMA_csv/1949.xls\")\n",
    "# a=polars.scan_csv(r'D:\\WORKcode\\\\pythoncode\\\\ncdata\\\\typath\\\\CMA_csv\\\\2003.xls')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function read_excel in module polars.io:\n",
      "\n",
      "read_excel(file: 'str | BytesIO | Path | BinaryIO | bytes', sheet_id: 'int | None' = 1, sheet_name: 'str | None' = None, xlsx2csv_options: 'dict[str, object] | None' = None, read_csv_options: 'dict[str, object] | None' = None) -> 'DataFrame | dict[str, DataFrame]'\n",
      "    Read Excel (XLSX) sheet into a DataFrame.\n",
      "    \n",
      "    Converts an Excel sheet with ``xlsx2csv.Xlsx2csv().convert()`` to CSV and parses the\n",
      "    CSV output with :func:`read_csv`.\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    file\n",
      "        Path to a file or a file-like object.\n",
      "        By file-like object, we refer to objects with a ``read()`` method, such as a\n",
      "        file handler (e.g. via builtin ``open`` function) or ``BytesIO``.\n",
      "    sheet_id\n",
      "        Sheet number to convert (0 for all sheets).\n",
      "    sheet_name\n",
      "        Sheet name to convert.\n",
      "    xlsx2csv_options\n",
      "        Extra options passed to ``xlsx2csv.Xlsx2csv()``.\n",
      "        e.g.: ``{\"skip_empty_lines\": True}``\n",
      "    read_csv_options\n",
      "        Extra options passed to :func:`read_csv` for parsing the CSV file returned by\n",
      "        ``xlsx2csv.Xlsx2csv().convert()``\n",
      "        e.g.: ``{\"has_header\": False, \"new_columns\": [\"a\", \"b\", \"c\"],\n",
      "        infer_schema_length=None}``\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    DataFrame\n",
      "    \n",
      "    Examples\n",
      "    --------\n",
      "    Read \"My Datasheet\" sheet from Excel sheet file to a DataFrame.\n",
      "    \n",
      "    >>> excel_file = \"test.xlsx\"\n",
      "    >>> sheet_name = \"My Datasheet\"\n",
      "    >>> pl.read_excel(\n",
      "    ...     file=excel_file,\n",
      "    ...     sheet_name=sheet_name,\n",
      "    ... )  # doctest: +SKIP\n",
      "    \n",
      "    Read sheet 3 from Excel sheet file to a DataFrame while skipping empty lines in the\n",
      "    sheet. As sheet 3 does not have header row, pass the needed settings to\n",
      "    :func:`read_csv`.\n",
      "    \n",
      "    >>> excel_file = \"test.xlsx\"\n",
      "    >>> pl.read_excel(\n",
      "    ...     file=excel_file,\n",
      "    ...     sheet_id=3,\n",
      "    ...     xlsx2csv_options={\"skip_empty_lines\": True},\n",
      "    ...     read_csv_options={\"has_header\": False, \"new_columns\": [\"a\", \"b\", \"c\"]},\n",
      "    ... )  # doctest: +SKIP\n",
      "    \n",
      "    If the correct datatypes can't be determined by polars, look at :func:`read_csv`\n",
      "    documentation to see which options you can pass to fix this issue. For example\n",
      "    ``\"infer_schema_length\": None`` can be used to read the whole data twice, once to\n",
      "    infer the correct output types and once to actually convert the input to the correct\n",
      "    types. With `\"infer_schema_length\": 1000``, only the first 1000 lines are read\n",
      "    twice.\n",
      "    \n",
      "    >>> excel_file = \"test.xlsx\"\n",
      "    >>> pl.read_excel(\n",
      "    ...     file=excel_file,\n",
      "    ...     read_csv_options={\"infer_schema_length\": None},\n",
      "    ... )  # doctest: +SKIP\n",
      "    \n",
      "    If :func:`read_excel` does not work or you need to read other types of spreadsheet\n",
      "    files, you can try pandas ``pd.read_excel()``\n",
      "    (supports `xls`, `xlsx`, `xlsm`, `xlsb`, `odf`, `ods` and `odt`).\n",
      "    \n",
      "    >>> excel_file = \"test.xlsx\"\n",
      "    >>> pl.from_pandas(pd.read_excel(excel_file))  # doctest: +SKIP\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(polars.read_excel)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe td {\n",
       "        white-space: pre;\n",
       "    }\n",
       "\n",
       "    .dataframe td {\n",
       "        padding-top: 0;\n",
       "    }\n",
       "\n",
       "    .dataframe td {\n",
       "        padding-bottom: 0;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\" >\n",
       "<small>shape: (717, 8)</small>\n",
       "<thead>\n",
       "<tr>\n",
       "<th>\n",
       "number\n",
       "</th>\n",
       "<th>\n",
       "name_en\n",
       "</th>\n",
       "<th>\n",
       "time\n",
       "</th>\n",
       "<th>\n",
       "lon\n",
       "</th>\n",
       "<th>\n",
       "lat\n",
       "</th>\n",
       "<th>\n",
       "level\n",
       "</th>\n",
       "<th>\n",
       "pressure\n",
       "</th>\n",
       "<th>\n",
       "wind\n",
       "</th>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "str\n",
       "</td>\n",
       "<td>\n",
       "str\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "f64\n",
       "</td>\n",
       "<td>\n",
       "str\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "<td>\n",
       "i64\n",
       "</td>\n",
       "</tr>\n",
       "</thead>\n",
       "<tbody>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-15 06:...\n",
       "</td>\n",
       "<td>\n",
       "163.1\n",
       "</td>\n",
       "<td>\n",
       "6.9\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1004\n",
       "</td>\n",
       "<td>\n",
       "12\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-15 12:...\n",
       "</td>\n",
       "<td>\n",
       "161.2\n",
       "</td>\n",
       "<td>\n",
       "7.6\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1004\n",
       "</td>\n",
       "<td>\n",
       "12\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-15 18:...\n",
       "</td>\n",
       "<td>\n",
       "159.7\n",
       "</td>\n",
       "<td>\n",
       "8.2\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1004\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-16 00:...\n",
       "</td>\n",
       "<td>\n",
       "158.2\n",
       "</td>\n",
       "<td>\n",
       "8.7\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1004\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-16 06:...\n",
       "</td>\n",
       "<td>\n",
       "156.7\n",
       "</td>\n",
       "<td>\n",
       "9.4\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1004\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-16 12:...\n",
       "</td>\n",
       "<td>\n",
       "154.3\n",
       "</td>\n",
       "<td>\n",
       "10.2\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1004\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-16 18:...\n",
       "</td>\n",
       "<td>\n",
       "152.8\n",
       "</td>\n",
       "<td>\n",
       "11.0\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1004\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-17 00:...\n",
       "</td>\n",
       "<td>\n",
       "150.9\n",
       "</td>\n",
       "<td>\n",
       "11.7\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1004\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-17 06:...\n",
       "</td>\n",
       "<td>\n",
       "149.5\n",
       "</td>\n",
       "<td>\n",
       "12.4\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1002\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-17 12:...\n",
       "</td>\n",
       "<td>\n",
       "148.6\n",
       "</td>\n",
       "<td>\n",
       "12.9\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1002\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-17 18:...\n",
       "</td>\n",
       "<td>\n",
       "147.8\n",
       "</td>\n",
       "<td>\n",
       "13.2\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1002\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200301\n",
       "</td>\n",
       "<td>\n",
       "&quot;Yanyan&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-01-18 00:...\n",
       "</td>\n",
       "<td>\n",
       "146.8\n",
       "</td>\n",
       "<td>\n",
       "13.6\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带低压&quot;\n",
       "</td>\n",
       "<td>\n",
       "1000\n",
       "</td>\n",
       "<td>\n",
       "15\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "<td>\n",
       "...\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-11-29 00:...\n",
       "</td>\n",
       "<td>\n",
       "131.0\n",
       "</td>\n",
       "<td>\n",
       "18.4\n",
       "</td>\n",
       "<td>\n",
       "&quot;强台风&quot;\n",
       "</td>\n",
       "<td>\n",
       "950\n",
       "</td>\n",
       "<td>\n",
       "45\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-11-29 06:...\n",
       "</td>\n",
       "<td>\n",
       "130.9\n",
       "</td>\n",
       "<td>\n",
       "19.2\n",
       "</td>\n",
       "<td>\n",
       "&quot;强台风&quot;\n",
       "</td>\n",
       "<td>\n",
       "950\n",
       "</td>\n",
       "<td>\n",
       "45\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-11-29 12:...\n",
       "</td>\n",
       "<td>\n",
       "131.0\n",
       "</td>\n",
       "<td>\n",
       "20.0\n",
       "</td>\n",
       "<td>\n",
       "&quot;强台风&quot;\n",
       "</td>\n",
       "<td>\n",
       "950\n",
       "</td>\n",
       "<td>\n",
       "45\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-11-29 18:...\n",
       "</td>\n",
       "<td>\n",
       "131.8\n",
       "</td>\n",
       "<td>\n",
       "20.8\n",
       "</td>\n",
       "<td>\n",
       "&quot;强台风&quot;\n",
       "</td>\n",
       "<td>\n",
       "950\n",
       "</td>\n",
       "<td>\n",
       "45\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-11-30 00:...\n",
       "</td>\n",
       "<td>\n",
       "132.6\n",
       "</td>\n",
       "<td>\n",
       "21.8\n",
       "</td>\n",
       "<td>\n",
       "&quot;强台风&quot;\n",
       "</td>\n",
       "<td>\n",
       "950\n",
       "</td>\n",
       "<td>\n",
       "45\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-11-30 06:...\n",
       "</td>\n",
       "<td>\n",
       "133.8\n",
       "</td>\n",
       "<td>\n",
       "23.0\n",
       "</td>\n",
       "<td>\n",
       "&quot;台风&quot;\n",
       "</td>\n",
       "<td>\n",
       "960\n",
       "</td>\n",
       "<td>\n",
       "40\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-11-30 12:...\n",
       "</td>\n",
       "<td>\n",
       "135.5\n",
       "</td>\n",
       "<td>\n",
       "24.4\n",
       "</td>\n",
       "<td>\n",
       "&quot;台风&quot;\n",
       "</td>\n",
       "<td>\n",
       "960\n",
       "</td>\n",
       "<td>\n",
       "40\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-11-30 18:...\n",
       "</td>\n",
       "<td>\n",
       "137.6\n",
       "</td>\n",
       "<td>\n",
       "26.1\n",
       "</td>\n",
       "<td>\n",
       "&quot;台风&quot;\n",
       "</td>\n",
       "<td>\n",
       "965\n",
       "</td>\n",
       "<td>\n",
       "35\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-12-01 00:...\n",
       "</td>\n",
       "<td>\n",
       "139.1\n",
       "</td>\n",
       "<td>\n",
       "27.1\n",
       "</td>\n",
       "<td>\n",
       "&quot;强热带风暴&quot;\n",
       "</td>\n",
       "<td>\n",
       "970\n",
       "</td>\n",
       "<td>\n",
       "30\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-12-01 06:...\n",
       "</td>\n",
       "<td>\n",
       "140.3\n",
       "</td>\n",
       "<td>\n",
       "29.3\n",
       "</td>\n",
       "<td>\n",
       "&quot;强热带风暴&quot;\n",
       "</td>\n",
       "<td>\n",
       "980\n",
       "</td>\n",
       "<td>\n",
       "28\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-12-01 12:...\n",
       "</td>\n",
       "<td>\n",
       "141.7\n",
       "</td>\n",
       "<td>\n",
       "30.9\n",
       "</td>\n",
       "<td>\n",
       "&quot;强热带风暴&quot;\n",
       "</td>\n",
       "<td>\n",
       "985\n",
       "</td>\n",
       "<td>\n",
       "25\n",
       "</td>\n",
       "</tr>\n",
       "<tr>\n",
       "<td>\n",
       "200321\n",
       "</td>\n",
       "<td>\n",
       "&quot;Lupit&quot;\n",
       "</td>\n",
       "<td>\n",
       "&quot;2003-12-01 18:...\n",
       "</td>\n",
       "<td>\n",
       "144.1\n",
       "</td>\n",
       "<td>\n",
       "32.2\n",
       "</td>\n",
       "<td>\n",
       "&quot;热带风暴&quot;\n",
       "</td>\n",
       "<td>\n",
       "988\n",
       "</td>\n",
       "<td>\n",
       "23\n",
       "</td>\n",
       "</tr>\n",
       "</tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "shape: (717, 8)\n",
       "┌────────┬─────────┬─────────────────────┬───────┬──────┬────────────┬──────────┬──────┐\n",
       "│ number ┆ name_en ┆ time                ┆ lon   ┆ lat  ┆ level      ┆ pressure ┆ wind │\n",
       "│ ---    ┆ ---     ┆ ---                 ┆ ---   ┆ ---  ┆ ---        ┆ ---      ┆ ---  │\n",
       "│ i64    ┆ str     ┆ str                 ┆ f64   ┆ f64  ┆ str        ┆ i64      ┆ i64  │\n",
       "╞════════╪═════════╪═════════════════════╪═══════╪══════╪════════════╪══════════╪══════╡\n",
       "│ 200301 ┆ Yanyan  ┆ 2003-01-15 06:00:00 ┆ 163.1 ┆ 6.9  ┆ 热带低压   ┆ 1004     ┆ 12   │\n",
       "├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤\n",
       "│ 200301 ┆ Yanyan  ┆ 2003-01-15 12:00:00 ┆ 161.2 ┆ 7.6  ┆ 热带低压   ┆ 1004     ┆ 12   │\n",
       "├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤\n",
       "│ 200301 ┆ Yanyan  ┆ 2003-01-15 18:00:00 ┆ 159.7 ┆ 8.2  ┆ 热带低压   ┆ 1004     ┆ 15   │\n",
       "├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤\n",
       "│ 200301 ┆ Yanyan  ┆ 2003-01-16 00:00:00 ┆ 158.2 ┆ 8.7  ┆ 热带低压   ┆ 1004     ┆ 15   │\n",
       "├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤\n",
       "│ ...    ┆ ...     ┆ ...                 ┆ ...   ┆ ...  ┆ ...        ┆ ...      ┆ ...  │\n",
       "├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤\n",
       "│ 200321 ┆ Lupit   ┆ 2003-12-01 00:00:00 ┆ 139.1 ┆ 27.1 ┆ 强热带风暴 ┆ 970      ┆ 30   │\n",
       "├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤\n",
       "│ 200321 ┆ Lupit   ┆ 2003-12-01 06:00:00 ┆ 140.3 ┆ 29.3 ┆ 强热带风暴 ┆ 980      ┆ 28   │\n",
       "├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤\n",
       "│ 200321 ┆ Lupit   ┆ 2003-12-01 12:00:00 ┆ 141.7 ┆ 30.9 ┆ 强热带风暴 ┆ 985      ┆ 25   │\n",
       "├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤\n",
       "│ 200321 ┆ Lupit   ┆ 2003-12-01 18:00:00 ┆ 144.1 ┆ 32.2 ┆ 热带风暴   ┆ 988      ┆ 23   │\n",
       "└────────┴─────────┴─────────────────────┴───────┴──────┴────────────┴──────────┴──────┘"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import polars as pl \n",
    "import pandas as pd \n",
    "pl.from_pandas(pd.read_excel('D:\\WORKcode\\pythoncode\\\\ncdata\\\\typath\\CMA_csv\\\\2003.xls'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function from_pandas in module polars.convert:\n",
      "\n",
      "from_pandas(df: 'pd.DataFrame | pd.Series | pd.DatetimeIndex', rechunk: 'bool' = True, nan_to_none: 'bool' = True) -> 'DataFrame | Series'\n",
      "    Construct a Polars DataFrame or Series from a pandas DataFrame or Series.\n",
      "    \n",
      "    This operation clones data.\n",
      "    \n",
      "    This requires that :mod:`pandas` and :mod:`pyarrow` are installed.\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    df: :class:`pandas.DataFrame`, :class:`pandas.Series`, :class:`pandas.DatetimeIndex`\n",
      "        Data represented as a pandas DataFrame, Series, or DatetimeIndex.\n",
      "    rechunk : bool, default True\n",
      "        Make sure that all data is in contiguous memory.\n",
      "    nan_to_none : bool, default True\n",
      "        If data contains `NaN` values PyArrow will convert the ``NaN`` to ``None``\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    :class:`DataFrame`\n",
      "    \n",
      "    Examples\n",
      "    --------\n",
      "    Constructing a :class:`DataFrame` from a :class:`pandas.DataFrame`:\n",
      "    \n",
      "    >>> import pandas as pd\n",
      "    >>> pd_df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=[\"a\", \"b\", \"c\"])\n",
      "    >>> df = pl.from_pandas(pd_df)\n",
      "    >>> df\n",
      "        shape: (2, 3)\n",
      "    ┌─────┬─────┬─────┐\n",
      "    │ a   ┆ b   ┆ c   │\n",
      "    │ --- ┆ --- ┆ --- │\n",
      "    │ i64 ┆ i64 ┆ i64 │\n",
      "    ╞═════╪═════╪═════╡\n",
      "    │ 1   ┆ 2   ┆ 3   │\n",
      "    ├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┤\n",
      "    │ 4   ┆ 5   ┆ 6   │\n",
      "    └─────┴─────┴─────┘\n",
      "    \n",
      "    Constructing a Series from a :class:`pd.Series`:\n",
      "    \n",
      "    >>> import pandas as pd\n",
      "    >>> pd_series = pd.Series([1, 2, 3], name=\"pd\")\n",
      "    >>> df = pl.from_pandas(pd_series)\n",
      "    >>> df\n",
      "    shape: (3,)\n",
      "    Series: 'pd' [i64]\n",
      "    [\n",
      "        1\n",
      "        2\n",
      "        3\n",
      "    ]\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(pl.from_pandas)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "df =pd.read_excel('D:\\WORKcode\\pythoncode\\\\ncdata\\\\typath\\CMA_csv\\\\2003.xls')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>number</th>\n",
       "      <th>name_en</th>\n",
       "      <th>time</th>\n",
       "      <th>lon</th>\n",
       "      <th>lat</th>\n",
       "      <th>level</th>\n",
       "      <th>pressure</th>\n",
       "      <th>wind</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>200301</td>\n",
       "      <td>Yanyan</td>\n",
       "      <td>2003-01-15 06:00:00</td>\n",
       "      <td>163.1</td>\n",
       "      <td>6.9</td>\n",
       "      <td>热带低压</td>\n",
       "      <td>1004</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>200301</td>\n",
       "      <td>Yanyan</td>\n",
       "      <td>2003-01-15 12:00:00</td>\n",
       "      <td>161.2</td>\n",
       "      <td>7.6</td>\n",
       "      <td>热带低压</td>\n",
       "      <td>1004</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>200301</td>\n",
       "      <td>Yanyan</td>\n",
       "      <td>2003-01-15 18:00:00</td>\n",
       "      <td>159.7</td>\n",
       "      <td>8.2</td>\n",
       "      <td>热带低压</td>\n",
       "      <td>1004</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>200301</td>\n",
       "      <td>Yanyan</td>\n",
       "      <td>2003-01-16 00:00:00</td>\n",
       "      <td>158.2</td>\n",
       "      <td>8.7</td>\n",
       "      <td>热带低压</td>\n",
       "      <td>1004</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>200301</td>\n",
       "      <td>Yanyan</td>\n",
       "      <td>2003-01-16 06:00:00</td>\n",
       "      <td>156.7</td>\n",
       "      <td>9.4</td>\n",
       "      <td>热带低压</td>\n",
       "      <td>1004</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>712</th>\n",
       "      <td>200321</td>\n",
       "      <td>Lupit</td>\n",
       "      <td>2003-11-30 18:00:00</td>\n",
       "      <td>137.6</td>\n",
       "      <td>26.1</td>\n",
       "      <td>台风</td>\n",
       "      <td>965</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>713</th>\n",
       "      <td>200321</td>\n",
       "      <td>Lupit</td>\n",
       "      <td>2003-12-01 00:00:00</td>\n",
       "      <td>139.1</td>\n",
       "      <td>27.1</td>\n",
       "      <td>强热带风暴</td>\n",
       "      <td>970</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>714</th>\n",
       "      <td>200321</td>\n",
       "      <td>Lupit</td>\n",
       "      <td>2003-12-01 06:00:00</td>\n",
       "      <td>140.3</td>\n",
       "      <td>29.3</td>\n",
       "      <td>强热带风暴</td>\n",
       "      <td>980</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>715</th>\n",
       "      <td>200321</td>\n",
       "      <td>Lupit</td>\n",
       "      <td>2003-12-01 12:00:00</td>\n",
       "      <td>141.7</td>\n",
       "      <td>30.9</td>\n",
       "      <td>强热带风暴</td>\n",
       "      <td>985</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>716</th>\n",
       "      <td>200321</td>\n",
       "      <td>Lupit</td>\n",
       "      <td>2003-12-01 18:00:00</td>\n",
       "      <td>144.1</td>\n",
       "      <td>32.2</td>\n",
       "      <td>热带风暴</td>\n",
       "      <td>988</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>717 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     number name_en                 time    lon   lat  level  pressure  wind\n",
       "0    200301  Yanyan  2003-01-15 06:00:00  163.1   6.9   热带低压      1004    12\n",
       "1    200301  Yanyan  2003-01-15 12:00:00  161.2   7.6   热带低压      1004    12\n",
       "2    200301  Yanyan  2003-01-15 18:00:00  159.7   8.2   热带低压      1004    15\n",
       "3    200301  Yanyan  2003-01-16 00:00:00  158.2   8.7   热带低压      1004    15\n",
       "4    200301  Yanyan  2003-01-16 06:00:00  156.7   9.4   热带低压      1004    15\n",
       "..      ...     ...                  ...    ...   ...    ...       ...   ...\n",
       "712  200321   Lupit  2003-11-30 18:00:00  137.6  26.1     台风       965    35\n",
       "713  200321   Lupit  2003-12-01 00:00:00  139.1  27.1  强热带风暴       970    30\n",
       "714  200321   Lupit  2003-12-01 06:00:00  140.3  29.3  强热带风暴       980    28\n",
       "715  200321   Lupit  2003-12-01 12:00:00  141.7  30.9  强热带风暴       985    25\n",
       "716  200321   Lupit  2003-12-01 18:00:00  144.1  32.2   热带风暴       988    23\n",
       "\n",
       "[717 rows x 8 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.10.4 ('py310')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.4"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "1af7d1ae3c55d82bbda2a5569c7a9f2f2d33ff4c43dd1c666120ac4867346c8c"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
